/**
 * Created by Administrator on 2017/6/14 0014.
 */
var upanddown=127;
$(window).scroll(function(){
    $(".quicklist").css("display","none");
    $("#refreshbtn").css("display","block");
    var mainheight=$(".home_feed").height();
    var windowheight=$(window).height();
    var what=$(".home_feed").offset().top;
    var chajuli=$(".home_feed").offset().top - $(window).scrollTop();
    var cz=windowheight-mainheight+50;
    if(chajuli<cz&&readyover===0){
        if(document.getElementById("explist").style.display=="block"&&jyover==0){
            jycurrentIndex++;
            readyover=1;
            jy(expurl,jycurrentIndex,pageSize,isheigh);
        }
    }
    //导航条隐藏显示
    //var a2=chajuli;
    //if(a2<upanddown){
    //    upanddown=a2;
    //    //向下滚动
    //    if(chajuli<36){
    //        $(".fixed_header").css({"position":"fixed","top":"-44px"});
    //        $(".wrapper.home_feed").css({"margin-top":"44px"});
    //        $("#page_wrapper").css("margin-top","44px");
    //    }
    //}
    //else{
    //    upanddown=a2;
    //    //向上滚动
    //    if(0<chajuli){
    //        $(".fixed_header").css({"position":"absolute","top":"0px"});
    //        $(".wrapper.home_feed").css({"margin-top":"0"});
    //        $("#page_wrapper").css("margin-top","83px");
    //    }
    //}
});
//刷新页面
$("#refreshbtn").click(function(){
    jycurrentIndex=1;
    $("#waiting1").css("display","block");
    $("#nonews1").css("display","none");
    $(".fixed_header").css({"position":"absolute","top":"0px"});
    $(".wrapper.home_feed").css({"margin-top":"0"});
    $("#page_wrapper").css("margin-top","127px");
    $("#explist .addlistplace div").remove();
    jy(expurl,jycurrentIndex,pageSize,isheigh);
});